package com.czy.enchantmentvisualization.utils;

import java.io.File;

public class FileNameUtil {

    public static String getYmlSuffix(String fileName){
        int i = fileName.lastIndexOf("\\");
        if(i == -1){
            i = fileName.lastIndexOf("/");
        }
        return fileName.substring(i + 1, fileName.lastIndexOf(".yml"));
    }

    public static String delSuffix(String fileName){
        return fileName.lastIndexOf(".") == -1 ? fileName :fileName.substring(0, fileName.lastIndexOf("."));
    }

}
